﻿''' <summary>
''' 基底クラス関連
''' </summary>
''' <remarks></remarks>
Public Class SuperRelation
    Implements IParentRelation

    Friend Sub New(myColumn As ColumnAttribute, yourColumn As ColumnAttribute)
        _myColumn = myColumn
        _yourColumn = yourColumn
    End Sub

    Private _myColumn As ColumnAttribute
    ''' <summary>
    ''' 自身の列
    ''' </summary>
    ''' <remarks>
    ''' #96　「Nリレーションクラスを継承するとDDLに失敗する」修正
    ''' 自身の列を管理するようにし、基底クラスの主キーが通常列、親列両方に対応します
    ''' </remarks>
    Public ReadOnly Property MyColumn As ColumnAttribute
        Get
            Return _myColumn
        End Get
    End Property

    Private _table As TableAttribute
    ''' <summary>
    ''' テーブル属性
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property Table As TableAttribute
        Get
            Return MyColumn.Table
        End Get
    End Property

    Private _MyColumnName As String
    ''' <summary>
    ''' 列名
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property MyColumnName As String Implements IParentRelation.MyColumnName
        Get
            Return MyColumn.ColumnName
        End Get
    End Property

    Public Sub Join(myInstance As Object, yourInstance As Object) Implements IParentRelation.Join
        Return '基底クラスのため、結合処理はありません
    End Sub

    Public ReadOnly Property IsSuperRelation As Boolean Implements IParentRelation.IsSuperRelation
        Get
            Return True
        End Get
    End Property

    Private _yourColumn As ColumnAttribute
    Public ReadOnly Property YourColumn As ColumnAttribute Implements IParentRelation.YourColumn
        Get
            Return _yourColumn
        End Get
    End Property

    Public ReadOnly Property YourColumnName As String Implements IParentRelation.YourColumnName
        Get
            Return Me.YourColumn.ColumnName
        End Get
    End Property

    Public ReadOnly Property IsNullable As Boolean Implements IParentRelation.IsNullable
        Get
            Return False
        End Get
    End Property

End Class
